<?php
namespace app\admin\validate;

use think\Validate;

class Staff extends Validate
{
    protected $rule = [
       'staff_name'=>'require|alphaNum|length:5,16|unique:staff',
        'nick_name'=>'require|max:16',
        'mobile'=>'require',
       'password'=>'require|alphaNum|length:5,16'
    ];
    protected $message = [
    	'staff_name.require'=>'登陆名不能为空',
        'staff_name.alphaNum'=>'登陆名只能为字母和数子',
        'staff_name.length'=>'登陆名长度为5到16位',
        'staff_name.unique'=>'该登陆名已存在',
        'nick_name.require'=>'昵称不能为空',
        'nick_name.length'=>'昵称长度不能超过16位',
        'mobile.require'=>'手机号不能为空',
        'password.require'=>'登陆密码不能为空',
        'password.alphaNum'=>'登陆密码只能为字母和数子',
        'password.length'=>'登陆密码长度为5到16位'
    ];

    public function sceneEdit()
    {
        return $this->remove('password', 'require');
    }
}
